"use strict";
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const common_vendor = require("./common/vendor.js");
const debug_GenerateTestUserSig = require("./debug/GenerateTestUserSig.js");
const debug_aegis = require("./debug/aegis.js");
require("./debug/lib-generate-test-usersig-es.min.js");
if (!Math) {
  "./pages/index/index.js";
  "./pages/heart-profile/heart-profile.js";
  "./pages/consult/consult.js";
  "./pages/my/my.js";
  "./pages/login/login.js";
  "./pages/agreement/agreement.js";
  "./pages/feedback/feedback.js";
  "./pages/profile/profile.js";
  "./pages/TUIKit/TUIPages/TUIChat/index.js";
  "./pages/consultant-detail/consultant-detail.js";
}
const aegis = new common_vendor.Aegis({
  id: debug_aegis.aegisID,
  // 项目key
  reportApiSpeed: true
  // 接口测速
});
common_vendor.index.$aegis = aegis;
const config = {
  userID: "user1",
  //User ID
  SDKAppID: 1400811062,
  secretKey: "603f00551a0a1aec1f30475cc4d54c661dbd555e37347f0a68c5c7a518514e17"
  // Your secretKey
};
const userSig = debug_GenerateTestUserSig.genTestUserSig(config).userSig;
common_vendor.index.$chat_SDKAppID = config.SDKAppID;
common_vendor.index.$chat_userID = config.userID;
common_vendor.index.$chat_userSig = userSig;
common_vendor.index.$TUIKit = common_vendor.TIM.create({
  SDKAppID: common_vendor.index.$chat_SDKAppID
});
console.log(common_vendor.index.$TUIKit.TUIConversationServer);
console.log(common_vendor.index.$TUIKit);
common_vendor.index.$TIM = common_vendor.TIM;
common_vendor.index.$TUIKit.registerPlugin({
  "tim-upload-plugin": common_vendor.TIMUploadPlugin
});
const _sfc_main = {
  onLaunch: function() {
    this.bindTIMEvent();
    this.login();
  },
  methods: {
    login() {
      common_vendor.index.$TUIKit.login({
        userID: config.userID,
        userSig
      }).then((res) => {
        console.log("login!!");
      });
    },
    bindTIMEvent() {
      common_vendor.index.$TUIKit.on(common_vendor.index.$TIM.EVENT.SDK_READY, this.handleSDKReady);
      common_vendor.index.$TUIKit.on(common_vendor.index.$TIM.EVENT.SDK_NOT_READY, this.handleSDKNotReady);
      common_vendor.index.$TUIKit.on(common_vendor.index.$TIM.EVENT.KICKED_OUT, this.handleKickedOut);
    },
    // sdk ready 以后可调用 API
    handleSDKReady(event) {
      common_vendor.index.$chat_isSDKReady = true;
      console.log("ok!!");
    },
    handleSDKNotReady(event) {
      console.log("no ok!!");
      common_vendor.index.showToast({
        title: "警告！会话SDK未完成初始化",
        icon: "error"
      });
    },
    handleKickedOut(event) {
      common_vendor.index.clearStorageSync();
      common_vendor.index.showToast({
        title: `${this.kickedOutReason(event.data.type)}被踢出。`,
        icon: "none"
      });
    },
    kickedOutReason(type) {
      switch (type) {
        case common_vendor.index.$TIM.TYPES.KICKED_OUT_MULT_ACCOUNT:
          return "多实例登录";
        case common_vendor.index.$TIM.TYPES.KICKED_OUT_MULT_DEVICE:
          return "多设备登录";
        case common_vendor.index.$TIM.TYPES.KICKED_OUT_USERSIG_EXPIRED:
          return "userSig 过期";
        case common_vendor.index.$TIM.TIM.TYPES.KICKED_OUT_REST_API:
          return "REST API kick 接口踢出";
        default:
          return "";
      }
    }
  }
};
const App = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__file", "D:/Project/heart-3.0/heart-field-3.0/App.vue"]]);
function createApp() {
  const app = common_vendor.createSSRApp(App);
  return {
    app
  };
}
createApp().app.mount("#app");
exports.createApp = createApp;
